home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir36
/
dedate20.zip
/
DEDATE.DOC
next >
Wrap
Text File
|
1989-08-24
|
5KB
|
114 lines
DEDATE v2.00
A Year/Month/Day DOS errorlevel utility.
(C) Copyright 1989
Lefteris Tsintzelis
Brooklyn, NY
ALL RIGHTS RESERVED.
This program is released to the
public domain, and distribution is
permitted and encouraged.
However, if you wish to continue using
this program for more than 21 days then a fee
of $20 or more is strongly suggested.
DESCRIPTION
DEDATE is a small utility program that returns DOS errorlevels on a
specific date. Its use is for batch files. You can very well use this program
to execute other programs on a specific day of the week or of the month or
even the year. You can use it for your AUTOEXEC.BAT to back up your hard disk
every Sunday or to optimize your hard disk every Friday. I wrote this program
because I run a bulletin board system and want to optimize my hard disk every
Sunday automatically. Since there was no other program that I could use from
batch files I decided to write one. This is actually my very first program
so your opinion will count.
USAGE
Here is a sample of a batch file that would back up your hard disk every
Friday:
echo off
...
REM Backup my hard disk automatically on boot up every Friday.
dedate -w5 -e1
if errorlevel 1 goto back_up
:back_up
backup c:
REM Set DOS erroelevel to 0.
dedate -e0
...
Another example of a batch file to back up your hard disk every
Sunday and optimize it the 1st of every month would look like:
echo off
...
REM Back up hard disk if Sunday
dedate -w0 -e1
if errorlevel 1 backup c:
REM Optimize hard disk if 1st of every month
dedate -d1 -e1
if errorlevel 1 optimize c:
REM Reset DOS errorlevel to 0
dedate -e0
...
The available commands are: -y<1980 to 2099>
-m<1 to 12>
-d<1 to 31> depending on month and year.
-w<0 to 6> Sunday to Saturday respectively.
-e<0 to 9> DOS errorlevel.
The correct syntax is: DEDATE -yYYYY -mMM -dDD -wW -eE.
The order of the parameters does not really matter as long as they are
in SMALL CASE. if you type "DEDATE -W2 -E4" then you will get a parameter
error warning you. You can always refresh your memory with the available
commands by just typing "DEDATE". All parameters default to your current
machine settings if they are not specified. For example, if you don't
specify the errorlevel (-eE) then it will automatically default to 0. If you
don't specify the year (-yYYYY) it will automatically default to the current
year; same with month (-mMM), day (-dDD), and day of the week (-wW). So, if
you just type "DEDATE -e9" the program will exit with DOS errorlevel 9. If
you enter an invalid or out of range parameter then you will get a warning
message and the program will halt with DOS errorlevel 0.
"DEDATE -e4 -y1989 -m2 -d29" is not valid for a simple reason: February
does NOT have 29 days the year 1989! However, "DEDATE -e4 -y1988 -m2 -d29"
IS a valid option. "DEDATE -e1 -d31 -m4" is NOT valid because April does not
have 31 days. In any case, if you get an error message then you are probably
doing something wrong or you entering an out of range parameter.
As you see, the error checking is very strict so there is no danger of
entering a wrong day. You can use your imagination and a good manual that
explains errorlevels and batch files and create a fully automatic system
since I will not explain the errorlevels in full detail. As for creating
batch files (you probably already know how) you can use a simple text
editor and of course your DOS manual.
And of course:
I make no guarantee that this program will work in your machine. It
has been tested in an 8088, 80286 and 80386 based computers and worked
flawlessly. The requirements is a fully IBM (TM) XT compatible machine. Of
course, I am not to be help responsible for any kind of data loss that may
arise from the use or misuse of this program (if any, since this program
does not access anything particular but your system's date).
If you have any comments, problems or suggestions, please forward them to:
Lefteris Tsintzelis
18 Bowery, MCC #71
New York, NY 10013-5101
or you can leave a message on Olympic BBS where you can also find the latest
version of DEDATE.
Data Tel. #1: (718) 252-0534 Hayes V9600 - Public
Data Tel. #2: (718) 252-7514 USR Courier 9600 - Private
SysOp: Lefteris Tsintzelis.